package com.loby.data.mapper;

//import com.loby.data.handler.TableTypeHandler;
import com.loby.data.emun.TableType;
import com.loby.data.handler.TableTypeHandler;
import com.loby.data.history.pojo.MHisDataTables;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

@Mapper
public interface DataTableMapper {

     @Select("select * from m_his_data_tables where fk_mstation_id =#{id}")
     @Results(
                {@Result(column = "table_type",property = "tableType",jdbcType = JdbcType.INTEGER,
                        javaType = TableType.class,typeHandler = TableTypeHandler.class)}
        )
     List<MHisDataTables> getTablesByStationId(@Param("id") long id);
     @Select("call new_cod_day_table(#{id},#{mn})")
     int newCodDayTable(@Param("id") Long stationId,@Param("mn") String mn);
     @Select("call new_cod_hour_table(#{id},#{mn})")
     int newCodHourTable(@Param("id") Long stationId,@Param("mn") String mn);
     @Select("call new_cod_minute_table(#{id},#{mn})")
     int newCodMinTable(@Param("id") Long stationId,@Param("mn") String mn);
     @Select("call new_cod_real_table(#{id},#{mn})")
     int newCodRealTable(@Param("id") Long stationId,@Param("mn") String mn);
}
